//
//  DataBaseManager.h
//  VEW
//
//  Created by lanou3g on 15/7/28.
//  Copyright (c) 2015年 Y团. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import <UIKit/UIKit.h>
@class HomeModel;


@interface DataBaseManager : NSObject

//单例
+(instancetype)shareInstance;
//打开数据库
- (void)openDB;
//关闭数据库
- (void)closeDB;

//创建表
//- (void)creatTable;
//添加
-(void)insertNews:(HomeModel *)home;
//删
-(void)deleteNews:(HomeModel *)home;
//删除全部
-(void)deleteAll;
//查看
-(NSArray *)selectAllNews;
-(HomeModel *)selectWithNewsID:(NSString *)MyID;

//判断新闻是否被收藏
-(BOOL)isCollectNewsWithID:(NSString *)MyID;

//从数据库读取数据源
//-(void)setupNewsDataSource;

//获取新闻数
-(NSInteger)countOfNews;

//获取某个活动对象
- (HomeModel *)newsForRow:(NSInteger)row;

//删除某个活动对象
- (void)deleteNewsForRow:(NSInteger)row;

@end
